home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
biblio
/
bibtex
/
mac
/
macbibtex11.hqx
/
0.99c Sources
/
MacBibTeX 0.99c v1.1.sit
/
MacBibTex 0.99c V1.1
/
bibtex_2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-02
|
27KB
|
1,127 lines
#include "bibtex.h"
#include "bibtex.p"
#include "globals.h"
#include "coerce.h"
zbuildin ( pds , len , fnhashloc , bltinnum )
pdstype pds ;
pdslen len ;
hashloc * fnhashloc ;
bltinrange bltinnum ;
{predefine ( pds , len , 11 ) ;
* fnhashloc = predefloc ;
fntype [ *fnhashloc ] = 0 ;
ilkinfo [ *fnhashloc ] = bltinnum ;
;
#ifdef STAT
bltinloc [ bltinnum ] = *fnhashloc ;
executioncount [ bltinnum ] = 0 ;
#endif /* STAT */
}
predefcertainstrings () {
predefine ( ".aux " , 4 , 7 ) ;
sauxextension = hashtext [ predefloc ] ;
predefine ( ".bbl " , 4 , 7 ) ;
sbblextension = hashtext [ predefloc ] ;
predefine ( ".blg " , 4 , 7 ) ;
slogextension = hashtext [ predefloc ] ;
predefine ( ".bst " , 4 , 7 ) ;
sbstextension = hashtext [ predefloc ] ;
predefine ( ".bib " , 4 , 7 ) ;
sbibextension = hashtext [ predefloc ] ;
predefine ( "texinputs: " , 10 , 8 ) ;
sbstarea = hashtext [ predefloc ] ;
predefine ( "texbib: " , 7 , 8 ) ;
sbibarea = hashtext [ predefloc ] ;
predefine ( "\\citation " , 9 , 2 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "\\bibdata " , 8 , 2 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "\\bibstyle " , 9 , 2 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "\\@input " , 7 , 2 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "entry " , 5 , 4 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "execute " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "function " , 8 , 4 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "integers " , 8 , 4 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "iterate " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 4 ;
predefine ( "macro " , 5 , 4 ) ;
ilkinfo [ predefloc ] = 5 ;
predefine ( "read " , 4 , 4 ) ;
ilkinfo [ predefloc ] = 6 ;
predefine ( "reverse " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 7 ;
predefine ( "sort " , 4 , 4 ) ;
ilkinfo [ predefloc ] = 8 ;
predefine ( "strings " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 9 ;
predefine ( "comment " , 7 , 12 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "preamble " , 8 , 12 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "string " , 6 , 12 ) ;
ilkinfo [ predefloc ] = 2 ;
buildin ( "= " , 1 , bequals , 0 ) ;
buildin ( "> " , 1 , bgreaterthan , 1 ) ;
buildin ( "< " , 1 , blessthan , 2 ) ;
buildin ( "+ " , 1 , bplus , 3 ) ;
buildin ( "- " , 1 , bminus , 4 ) ;
buildin ( "* " , 1 , bconcatenate , 5 ) ;
buildin ( ":= " , 2 , bgets , 6 ) ;
buildin ( "add.period$ " , 11 , baddperiod , 7 ) ;
buildin ( "call.type$ " , 10 , bcalltype , 8 ) ;
buildin ( "change.case$" , 12 , bchangecase , 9 ) ;
buildin ( "chr.to.int$ " , 11 , bchrtoint , 10 ) ;
buildin ( "cite$ " , 5 , bcite , 11 ) ;
buildin ( "duplicate$ " , 10 , bduplicate , 12 ) ;
buildin ( "empty$ " , 6 , bempty , 13 ) ;
buildin ( "format.name$" , 12 , bformatname , 14 ) ;
buildin ( "if$ " , 3 , bif , 15 ) ;
buildin ( "int.to.chr$ " , 11 , binttochr , 16 ) ;
buildin ( "int.to.str$ " , 11 , binttostr , 17 ) ;
buildin ( "missing$ " , 8 , bmissing , 18 ) ;
buildin ( "newline$ " , 8 , bnewline , 19 ) ;
buildin ( "num.names$ " , 10 , bnumnames , 20 ) ;
buildin ( "pop$ " , 4 , bpop , 21 ) ;
buildin ( "preamble$ " , 9 , bpreamble , 22 ) ;
buildin ( "purify$ " , 7 , bpurify , 23 ) ;
buildin ( "quote$ " , 6 , bquote , 24 ) ;
buildin ( "skip$ " , 5 , bskip , 25 ) ;
buildin ( "stack$ " , 6 , bstack , 26 ) ;
buildin ( "substring$ " , 10 , bsubstring , 27 ) ;
buildin ( "swap$ " , 5 , bswap , 28 ) ;
buildin ( "text.length$" , 12 , btextlength , 29 ) ;
buildin ( "text.prefix$" , 12 , btextprefix , 30 ) ;
buildin ( "top$ " , 4 , btopstack , 31 ) ;
buildin ( "type$ " , 5 , btype , 32 ) ;
buildin ( "warning$ " , 8 , bwarning , 33 ) ;
buildin ( "width$ " , 6 , bwidth , 35 ) ;
buildin ( "while$ " , 6 , bwhile , 34 ) ;
buildin ( "width$ " , 6 , bwidth , 35 ) ;
buildin ( "write$ " , 6 , bwrite , 36 ) ;
predefine ( " " , 0 , 0 ) ;
snull = hashtext [ predefloc ] ;
fntype [ predefloc ] = 3 ;
predefine ( "default.type" , 12 , 0 ) ;
sdefault = hashtext [ predefloc ] ;
fntype [ predefloc ] = 3 ;
bdefault = bskip ;
preambleptr = 0 ;
predefine ( "i " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "j " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "oe " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "OE " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "ae " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 4 ;
predefine ( "AE " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 5 ;
predefine ( "aa " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 6 ;
predefine ( "AA " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 7 ;
predefine ( "o " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 8 ;
predefine ( "O " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 9 ;
predefine ( "l " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 10 ;
predefine ( "L " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 11 ;
predefine ( "ss " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 12 ;
predefine ( "crossref " , 8 , 11 ) ;
fntype [ predefloc ] = 4 ;
ilkinfo [ predefloc ] = numfields ;
crossrefnum = numfields ;
incr ( numfields ) ;
numpredefinedfields = numfields ;
predefine ( "sort.key$ " , 9 , 11 ) ;
fntype [ predefloc ] = 6 ;
ilkinfo [ predefloc ] = numentstrs ;
sortkeynum = numentstrs ;
incr ( numentstrs ) ;
predefine ( "entry.max$ " , 10 , 11 ) ;
fntype [ predefloc ] = 7 ;
ilkinfo [ predefloc ] = entstrsize ;
predefine ( "global.max$ " , 11 , 11 ) ;
fntype [ predefloc ] = 7 ;
ilkinfo [ predefloc ] = globstrsize ;
}
boolean zscan1 ( char1 )
ASCIIcode char1 ;
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( bufptr2 < last ) ) ) incr (
bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean zscan1white ( char1 )
ASCIIcode char1 ;
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( buffer [ bufptr2 ]
!= char1 ) && ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean zscan2 ( char1 , char2 )
ASCIIcode char1 , char2 ;
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean zscan2white ( char1 , char2 )
ASCIIcode char1 , char2 ;
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last ) ) ) incr (
bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean zscan3 ( char1 , char2 , char3 )
ASCIIcode char1 , char2 , char3 ;
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( buffer [ bufptr2 ] != char3 ) && ( bufptr2 < last ) ) ) incr ( bufptr2
) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean scanalpha () {
register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 2 ) && ( bufptr2 < last ) ) )
incr ( bufptr2 ) ;
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
Result = false ;
else Result = true ;
return(Result) ;
}
zscanidentifier ( char1 , char2 , char3 )
ASCIIcode char1 , char2 , char3 ;
{bufptr1 = bufptr2 ;
if ( ( lexclass [ buffer [ bufptr2 ] ] != 3 ) )
while ( ( ( idclass [ buffer [ bufptr2 ] ] == 1 ) && ( bufptr2 < last ) ) )
incr ( bufptr2 ) ;
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
scanresult = 0 ;
else if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last )
) )
scanresult = 3 ;
else if ( ( ( buffer [ bufptr2 ] == char1 ) || ( buffer [ bufptr2 ] == char2
) || ( buffer [ bufptr2 ] == char3 ) ) )
scanresult = 1 ;
else scanresult = 2 ;
}
boolean scannonneginteger () {
register boolean Result; bufptr1 = bufptr2 ;
tokenvalue = 0 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 3 ) && ( bufptr2 < last ) ) )
{
tokenvalue = tokenvalue * 10 + ( buffer [ bufptr2 ] - 48 ) ;
incr ( bufptr2 ) ;
}
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
Result = false ;
else Result = true ;
return(Result) ;
}
boolean scaninteger () {
register boolean Result; schar signlength ;
bufptr1 = bufptr2 ;
if ( ( buffer [ bufptr2 ] == 45 ) )
{
signlength = 1 ;
incr ( bufptr2 ) ;
}
else signlength = 0 ;
tokenvalue = 0 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 3 ) && ( bufptr2 < last ) ) )
{
tokenvalue = tokenvalue * 10 + ( buffer [ bufptr2 ] - 48 ) ;
incr ( bufptr2 ) ;
}
if ( ( ( signlength == 1 ) ) )
tokenvalue = - (integer) tokenvalue ;
if ( ( ( bufptr2 - bufptr1 ) == signlength ) )
Result = false ;
else Result = true ;
return(Result) ;
}
boolean scanwhitespace () {
register boolean Result; while ( ( ( lexclass [
buffer [ bufptr2 ] ] == 1 ) && ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean eatbstwhitespace () {
/* 10 */ register boolean Result; while ( true )
{
if ( ( scanwhitespace () ) )
if ( ( buffer [ bufptr2 ] != 37 ) )
{
Result = true ;
goto lab10 ;
}
if ( ( ! inputln ( bstfile ) ) )
{
Result = false ;
goto lab10 ;
}
incr ( bstlinenum ) ;
bufptr2 = 0 ;
}
lab10: ;
return(Result) ;
}
skiptokenprint () {
{
(void) putc( '-' , logfile );
(void) putc( '-' , stdout );
}
bstlnnumprint () ;
markerror () ;
if ( ( scan2white ( 125 , 37 ) ) )
;
}
printrecursionillega () {
;
#ifdef TRACE
{
(void) putc('\n', logfile );
}
#endif /* TRACE */
{
(void) fprintf( logfile , "%s\n", "Curse you, wizard, before you recurse me:" ) ;
(void) fprintf( stdout , "%s\n", "Curse you, wizard, before you recurse me:" ) ;
}
{
(void) Fputs( logfile , "function " ) ;
(void) Fputs( stdout , "function " ) ;
}
printatoken () ;
{
(void) fprintf( logfile , "%s\n", " is illegal in its own definition" ) ;
(void) fprintf( stdout , "%s\n", " is illegal in its own definition" ) ;
}
skiptokenprint () ;
}
skptokenunknownfunct () {
printatoken () ;
{
(void) Fputs( logfile , " is an unknown function" ) ;
(void) Fputs( stdout , " is an unknown function" ) ;
}
skiptokenprint () ;
}
skipillegalstuffafte () {
{
(void) fprintf( logfile , "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't follow a literal" ) ;
(void) fprintf( stdout , "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't follow a literal" ) ;
}
skiptokenprint () ;
}
zscanfndef ( fnhashloc )
hashloc fnhashloc ;
{/* 25 10 */ typedef integer fndefloc ;
hashptr2 singlfunction[singlefnspace + 1] ;
fndefloc singleptr ;
fndefloc copyptr ;
bufpointer endofnum ;
hashloc implfnloc ;
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) Fputs( logfile , "function" ) ;
(void) Fputs( stdout , "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
singleptr = 0 ;
while ( ( buffer [ bufptr2 ] != 125 ) ) {
switch ( ( buffer [ bufptr2 ] ) )
{case 35 :
{
incr ( bufptr2 ) ;
if ( ( ! scaninteger () ) )
{
{
(void) Fputs( logfile , "Illegal integer in integer literal" ) ;
(void) Fputs( stdout , "Illegal integer in integer literal" ) ;
}
skiptokenprint () ;
goto lab25 ;
}
;
#ifdef TRACE
{
(void) putc( '#' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) fprintf( logfile , "%s%ld\n", " is an integer literal with value " , (long)tokenvalue ) ;
}
#endif /* TRACE */
literalloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 1
, true ) ;
if ( ( ! hashfound ) )
{
fntype [ literalloc ] = 2 ;
ilkinfo [ literalloc ] = tokenvalue ;
}
if ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last )
&& ( buffer [ bufptr2 ] != 125 ) && ( buffer [ bufptr2 ] != 37 ) ) )
{
skipillegalstuffafte () ;
goto lab25 ;
}
{
singlfunction [ singleptr ] = literalloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
break ;
case 34 :
{
incr ( bufptr2 ) ;
if ( ( ! scan1 ( 34 ) ) )
{
{
(void) fprintf( logfile , "%s%c%s", "No `" , xchr [ 34 ] , "' to end string literal" ) ;
(void) fprintf( stdout , "%s%c%s", "No `" , xchr [ 34 ] , "' to end string literal" ) ;
}
skiptokenprint () ;
goto lab25 ;
}
;
#ifdef TRACE
{
(void) putc( '"' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) putc( '"' , logfile );
}
{
(void) fprintf( logfile , "%s\n", " is a string literal" ) ;
}
#endif /* TRACE */
literalloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 0
, true ) ;
fntype [ literalloc ] = 3 ;
incr ( bufptr2 ) ;
if ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last )
&& ( buffer [ bufptr2 ] != 125 ) && ( buffer [ bufptr2 ] != 37 ) ) )
{
skipillegalstuffafte () ;
goto lab25 ;
}
{
singlfunction [ singleptr ] = literalloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
break ;
case 39 :
{
incr ( bufptr2 ) ;
if ( ( scan2white ( 125 , 37 ) ) )
;
;
#ifdef TRACE
{
(void) putc( '\'' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) Fputs( logfile , " is a quoted function " ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
false ) ;
if ( ( ! hashfound ) )
{
skptokenunknownfunct () ;
goto lab25 ;
}
else {
if ( ( fnloc == wizloc ) )
{
printrecursionillega () ;
goto lab25 ;
}
else {
;
#ifdef TRACE
{
(void) Fputs( logfile , "of type " ) ;
}
traceprfnclass ( fnloc ) ;
{
(void) putc('\n', logfile );
}
#endif /* TRACE */
{
singlfunction [ singleptr ] = 0 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
{
singlfunction [ singleptr ] = fnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
}
}
break ;
case 123 :
{
exbuf [ 0 ] = 39 ;
inttoASCII ( implfnnum , exbuf , 1 , endofnum ) ;
implfnloc = strlookup ( exbuf , 0 , endofnum , 11 , true ) ;
if ( ( hashfound ) )
{
{
(void) Fputs( logfile , "Already encountered implicit function" ) ;
(void) Fputs( stdout , "Already encountered implicit function" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
;
#ifdef TRACE
{
outpoolstr ( logfile , hashtext [ implfnloc ] ) ;
}
{
(void) fprintf( logfile , "%s\n", " is an implicit function" ) ;
}
#endif /* TRACE */
incr ( implfnnum ) ;
fntype [ implfnloc ] = 1 ;
{
singlfunction [ singleptr ] = 0 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
{
singlfunction [ singleptr ] = implfnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
incr ( bufptr2 ) ;
scanfndef ( implfnloc ) ;
}
break ;
default:
{
if ( ( scan2white ( 125 , 37 ) ) )
;
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) Fputs( logfile , " is a function " ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
false ) ;
if ( ( ! hashfound ) )
{
skptokenunknownfunct () ;
goto lab25 ;
}
else if ( ( fnloc == wizloc ) )
{
printrecursionillega () ;
goto lab25 ;
}
else {
;
#ifdef TRACE
{
(void) Fputs( logfile , "of type " ) ;
}
traceprfnclass ( fnloc ) ;
{
(void) putc('\n', logfile );
}
#endif /* TRACE */
{
singlfunction [ singleptr ] = fnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
}
break ;
}
lab25: {
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) Fputs( logfile , "function" ) ;
(void) Fputs( stdout , "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
{
{
singlfunction [ singleptr ] = 5001 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
if ( ( singleptr + wizdefptr > wizfnspace ) )
{
{
(void) fprintf( logfile , "%ld%s", (long)singleptr + wizdefptr , ": " ) ;
(void) fprintf( stdout , "%ld%s", (long)singleptr + wizdefptr , ": " ) ;
}
{
printoverflow () ;
{
(void) fprintf( logfile , "%s%ld\n", "wizard-defined function space " , (long)wizfnspace )
;
(void) fprintf( stdout , "%s%ld\n", "wizard-defined function space " , (long)wizfnspace ) ;
}
longjmp(jmp9998,1) ;
}
}
ilkinfo [ fnhashloc ] = wizdefptr ;
copyptr = 0 ;
while ( ( copyptr < singleptr ) ) {
wizfunctions [ wizdefptr ] = singlfunction [ copyptr ] ;
incr ( copyptr ) ;
incr ( wizdefptr ) ;
}
}
incr ( bufptr2 ) ;
lab10: ;
}
boolean eatbibwhitespace () {
/* 10 */ register boolean Result; while ( ( !
scanwhitespace () ) ) {
if ( ( ! inputln ( bibfile [ bibptr ] ) ) )
{
Result = false ;
goto lab10 ;
}
incr ( biblinenum ) ;
bufptr2 = 0 ;
}
Result = true ;
lab10: ;
return(Result) ;
}
boolean compressbibwhite () {
/* 10 */ register boolean Result; Result = false
;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
while ( ( ! scanwhitespace () ) ) {
if ( ( ! inputln ( bibfile [ bibptr ] ) ) )
{
eatbibprint () ;
goto lab10 ;
}
incr ( biblinenum ) ;
bufptr2 = 0 ;
}
Result = true ;
lab10: ;
return(Result) ;
}
boolean scanbalancedbraces () {
/* 15 10 */ register boolean Result; Result =
false ;
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
if ( ( exbufptr > 1 ) )
if ( ( exbuf [ exbufptr - 1 ] == 32 ) )
if ( ( exbuf [ exbufptr - 2 ] == 32 ) )
decr ( exbufptr ) ;
bibbracelevel = 0 ;
if ( ( storefield ) )
{
while ( ( buffer [ bufptr2 ] != rightstrdelim ) ) switch ( ( buffer [
bufptr2 ] ) )
{case 123 :
{
incr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last
) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
{
while ( true ) switch ( ( buffer [ bufptr2 ] ) )
{case 125 :
{
decr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 125 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
if ( ( bibbracelevel == 0 ) )
goto lab15 ;
}
break ;
case 123 :
{
incr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
default:
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ bufptr2 ] ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
}
lab15: ;
}
}
break ;
case 125 :
{
bibunbalancedbracesp () ;
goto lab10 ;
}
break ;
default:
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ bufptr2 ] ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last
) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
}
}
else {
while ( ( buffer [ bufptr2 ] != rightstrdelim ) ) if ( ( buffer [ bufptr2
] == 123 ) )
{
incr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
while ( ( bibbracelevel > 0 ) ) {
if ( ( buffer [ bufptr2 ] == 125 ) )
{
decr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
else if ( ( buffer [ bufptr2 ] == 123 ) )
{
incr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
else {
incr ( bufptr2 ) ;
if ( ( ! scan2 ( 125 , 123 ) ) )
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
}
}
else if ( ( buffer [ bufptr2 ] == 125 ) )
{
bibunbalancedbracesp () ;
goto lab10 ;
}
else {
incr ( bufptr2 ) ;
if ( ( ! scan3 ( rightstrdelim , 123 , 125 ) ) )
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
}
incr ( bufptr2 ) ;
Result = true ;
lab10: ;
return(Result) ;
}
boolean scanafieldtokenandea () {
/* 10 */ register boolean Result; Result =
false ;
switch ( ( buffer [ bufptr2 ] ) )
{case 123 :
{
rightstrdelim = 125 ;
if ( ( ! scanbalancedbraces () ) )
goto lab10 ;
}
break ;
case 34 :
{
rightstrdelim = 34 ;
if ( ( ! scanbalancedbraces () ) )
goto lab10 ;
}
break ;
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
{
if ( ( ! scannonneginteger () ) )
{
{
(void) Fputs( logfile , "A digit disappeared" ) ;
(void) Fputs( stdout , "A digit disappeared" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
if ( ( storefield ) )
{
tmpptr = bufptr1 ;
while ( ( tmpptr < bufptr2 ) ) {
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ tmpptr ] ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
}
}
}
break ;
default:
{
scanidentifier ( 44 , rightouterdelim , 35 ) ;
{
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bibidprint () ;
{
{
(void) Fputs( logfile , "a field part" ) ;
(void) Fputs( stdout , "a field part" ) ;
}
biberrprint () ;
goto lab10 ;
}
}
}
if ( ( storefield ) )
{
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
macronameloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ,
13 , false ) ;
storetoken = true ;
if ( ( atbibcommand ) )
if ( ( commandnum == 2 ) )
if ( ( macronameloc == curmacroloc ) )
{
storetoken = false ;
{
macrowarnprint () ;
{
{
(void) fprintf( logfile , "%s\n", "used in its own definition" ) ;
(void) fprintf( stdout , "%s\n", "used in its own definition" ) ;
}
bibwarnprint () ;
}
}
}
if ( ( ! hashfound ) )
{
storetoken = false ;
{
macrowarnprint () ;
{
{
(void) fprintf( logfile , "%s\n", "undefined" ) ;
(void) fprintf( stdout , "%s\n", "undefined" ) ;
}
bibwarnprint () ;
}
}
}
if ( ( storetoken ) )
{
tmpptr = strstart [ ilkinfo [ macronameloc ] ] ;
tmpendptr = strstart [ ilkinfo [ macronameloc ] + 1 ] ;
if ( ( exbufptr == 0 ) )
if ( ( ( lexclass [ strpool [ tmpptr ] ] == 1 ) && ( tmpptr <
tmpendptr ) ) )
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
while ( ( ( lexclass [ strpool [ tmpptr ] ] == 1 ) && ( tmpptr <
tmpendptr ) ) ) incr ( tmpptr ) ;
}
while ( ( tmpptr < tmpendptr ) ) {
if ( ( lexclass [ strpool [ tmpptr ] ] != 1 ) )
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = strpool [ tmpptr ] ;
incr ( exbufptr ) ;
}
}
else if ( ( exbuf [ exbufptr - 1 ] != 32 ) )
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
}
}
}
}
break ;
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
Result = true ;
lab10: ;
return(Result) ;
}